<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="./js/require-2.3.6.js"></script>
	</head>
	<body>
		<h1>Hello</h1>
		<div>
			<a href="#amd-cmp.html">前往amd-cmp.html</a>
			<a href="#@/simple-cmp.html">前往simple-cmp.html</a>
			<a href="#amd-cmp.html?name=123">前往amd-cmp.html?name=123</a>
			<a href="#@/simple-cmp.html?name=345">前往simple-cmp.html?name=345</a>
		</div>
		<div id="xx">
			
		</div>
		<script>
			require.config({
				// 优先加载的模块
				map: {
					"*": {
						'css': 'js/require-css-min.js'
					}
				},
				// 模块地址映射
				paths: {
					layer:"https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer",
					jquery: "https://lib.baomitu.com/jquery/1.12.4/jquery.min",
					'jq-spa': "../dist/jq-spa.min"
				},
				// 非标准amd脚本配置
				shim: {
					layer: {
						// 依赖包
						deps: ['jquery', 'css!https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/theme/default/layer.min.css'],
						// 从window的哪个属性获取导出对象
						exports: 'layer'
					}
				}
			})
			require(['jquery','jq-spa'],function(){
				$.spa.config({
					getHashChangeRenderDom: function(){
						return $('#xx');
					},
					alias: {
						'@':'/jq-spa/example'
					}
				})
				$.spa.route.init();
				// location.hash = "amd-cmp.html";
			})
		</script>
	</body>
</html>
